using Godot;

[GlobalClass]
public partial class CCharacterData : Resource
{
    [Export] public DIR mDir;
    [Export] public CState mState;
    [Export] public Vector2 mMoveTarget;
    [Export] public float mMoveSpeed;
    [Export] public Godot.Collections.Array<CSkill> mSkills = new();
    [Export] public SKILL_ID mDefauldID = SKILL_ID.SKILL_PYHSICS;
    [Export] public CHA_TYPE mChaType;
    [Export] public CSkillTarget mSkillTarget = new CSkillTarget();
    [Export] public float mLife = 100;
    [Export] public int mLevel = 1;
    [Export] public float mMaxLifeMulti = 1.0f;
    [Export] public int mMinLevel = 1;
    [Export] public int mMaxLevel = 30;
    [Export] public int mExp;

    public float MaxLife
    {
        get
        {
            return mLevel * 100 * mMaxLifeMulti;
        }
    }

    public virtual CCharacterData copy()
    {
        CCharacterData re = Duplicate() as CCharacterData;
        re.mState = mState.copy();
        re.mSkillTarget = mSkillTarget.copy();
        re.mSkills = new Godot.Collections.Array<CSkill>();
        foreach (var v in mSkills)
        {
            re.mSkills.Add(v.copy());
        }

        return re;
    }
}